import { defineStore } from 'pinia'

export const useMainStore = defineStore('main', {
  state: () => {
    return {
      count: 100,
      word: 'hello',
    }
  },

  getters: {
    countAdd(state): number {
      return state.count + 1
    },
  },

  actions: {
    changeCount(num: number) {
      this.count -= num
      this.word = 'hello word'
    },
  },
})
